home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / buzzmachines_massive.exe / Dev / Geoffroy Notefilter SourceCode / CookbookFilter.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-05-09  |  1.4 KB  |  56 lines

  1. // CookbookFilter.h: interface for the CookbookFilter class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4.  
  5. #if !defined(AFX_CookbookFilter_H__CAAC7A47_AD64_4BCC_B48B_DA65E2F4A9FE__INCLUDED_)
  6. #define AFX_CookbookFilter_H__CAAC7A47_AD64_4BCC_B48B_DA65E2F4A9FE__INCLUDED_
  7.  
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11.  
  12. #include <stdlib.h>
  13. #include <time.h>
  14. #include <math.h>
  15. #include <string.h>
  16. #include <windows.h>
  17. #include <float.h>
  18. #include "../mdk.h"
  19.  
  20. class CookbookFilter  
  21. {
  22. public:
  23.     void setBandwidth(float bandwidth);
  24.     void setdBGain(float dBGain);
  25.     void setSlope(float slope);
  26.     typedef enum {LPF,HPF,BPF,NOTCH,PEAKINGEQ,LOWSHELF,HIGHSHELF} filtertype;
  27.     
  28.     CookbookFilter();
  29.     virtual ~CookbookFilter();
  30.  
  31.     void setSampleRate(int samplesPerSec);
  32.     void setFrequency(float freq);
  33.     void setQ(float q);
  34.     void setType(filtertype type);
  35.     void setGain(float gain);
  36.     bool MDKWorkStereo(float *psamples, int numsamples, int const mode);
  37.  
  38. private:
  39.     void computeCoeffs();
  40.  
  41. private:
  42.     float bandwidth;
  43.     float param_cutoff, param_resonance;
  44.     float filtCoefTab[5];
  45.     float lx1, lx2, ly1, ly2; // Left sample history
  46.     float rx1, rx2, ry1, ry2; // Right sample history
  47.     float gain;
  48.     int samplesPerSec;
  49.     filtertype type;
  50. protected:
  51.     float slope;
  52.     float dBGain;
  53. };
  54.  
  55. #endif // !defined(AFX_CookbookFilter_H__CAAC7A47_AD64_4BCC_B48B_DA65E2F4A9FE__INCLUDED_)
  56.